﻿using Microsoft.EntityFrameworkCore;
using ZenSystemService.Api.Data;
using ZenSystemService.Api.Entities;

namespace ZenSystemService.Api.Services
{
    public class AreaService
    {
        private readonly ApplicationDbContext _context;

        public AreaService(ApplicationDbContext context)
        {
            _context = context;
        }

        public async Task<IEnumerable<Area>> GetAllAreaAsync()
        {
            return await _context.Areas.OrderBy(item=>item.Code).ToListAsync();
        }
    }
}
